﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Assignment_2
{
    public partial class Form1 : Form
    {
        Pizza[] arrPizza = {   new Pizza(Assignment_2.Properties.Resources.CheesePizza, "Recipe 1", "Ingredient 1"),
                                   new Pizza(Assignment_2.Properties.Resources.VegCrunchyPizza, "Recipe 2", "Ingredient 2"),
                                   new Pizza(Assignment_2.Properties.Resources.ChinesePizza, "Recipe 3", "Ingredient 3"),
                                   new Pizza(Assignment_2.Properties.Resources.ItalianPizza, "Recipe 4", "Ingredient 4"),
                                   new Pizza(Assignment_2.Properties.Resources.VegeteablePizza, "Recipe 5", "Ingredient 5")
                               };

        public Form1()
        {
            InitializeComponent();
            
        }

        private void label3_Click(object sender, EventArgs e)
        {

        }

        private void pbPizzaImage_Click(object sender, EventArgs e)
        {

        }

        private void rdbCheese_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbCheese.Checked)
            {
                loadPizza(0);
            }
        }

        private void rdbVeg_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbVeg.Checked)
            {
                loadPizza(1);
            }
        }

        private void rdbChinese_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbChinese.Checked)
            {
                loadPizza(2);
            }
        }

        private void rdbItalian_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbItalian.Checked)
            {
                loadPizza(3);
            }
        }

        private void loadPizza(int index)
        {
            pbPizzaImage.Image = arrPizza[index].Img;
            txtIngre.Text = arrPizza[index].Ingre;
            txtRecipe.Text = arrPizza[index].Recipe;
        }

        private void rdbVegeteable_CheckedChanged(object sender, EventArgs e)
        {
            if (rdbVegeteable.Checked)
            {
                loadPizza(4);
            }
        }

        private void Form1_Load(object sender, EventArgs e)
        {
            rdbCheese.Checked = true;
        }
    }
}
